﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace canyinguanlixitong
{
    public partial class bkyy宾客预约 : Form
    {
        public bkyy宾客预约()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text.Trim().Equals(String.Empty))
            {
                MessageBox.Show("请填写顾客信息", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                abc();
            }
        }
        public void abc()
        {
            DBHelper a = new DBHelper();
            String an = @"insert into [Scheduled management](ydID,yhhm,ydTime,czmc,ydCz,ydMoney,ydQi)
VALUES('" + this.textBox1.Text + "'," + this.textBox2.Text + ",'" + this.dateTimePicker3.Text + "','" + this.comboBox2.Text + "'," + this.comboBox3.Text + "," + this.textBox4.Text + ",'" + this.textBox7.Text + "')";
            SqlConnection conn = new SqlConnection(a.strconn);
            conn.Open();
            SqlCommand comm = new SqlCommand(an, conn);
            int b = comm.ExecuteNonQuery();
            if (b > 0)
            {
                MessageBox.Show("预约成功！", "提示");
                this.Close();
            }
            else
            {
                MessageBox.Show("预约失败！", "提示");
            }
            conn.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            plyd批量预定 frm = new plyd批量预定();
            frm.Show();
            this.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void bkyy宾客预约_Load(object sender, EventArgs e)
        {

        }
    }
}
